# -*- coding: utf-8 -*- 
# @project : 《Atcoder》
# @Author : created by bensonrachel on 2021/7/13
# @File : C. Closest to the Right（CF）.py
# https://codeforces.com/edu/course/2/lesson/6/1/practice/contest/283911/problem/C

def bi(l,r,char,x):
    while(l+1<r):
        mid = (l+r)//2
        if(char[mid]<x):
            l =mid
        else:
            r =mid
    return r

def re(n,m,char,rate):
    for i in rate:
        if(i>char[-1]):
            print(n+1)
        else:
            x = bi(0,n+1,char,i)
            print(x)


if __name__ == '__main__':
    n,m =  map(int,input().split())
    char = [int(i) for i in input().split()]
    rate = [int(i) for i in input().split()]
    char.insert(0,0)
    re(n,m,char,rate)
